package cn.jr.service.impl;

import cn.jr.dao.IActiveDao;
import cn.jr.dao.impl.ActiveDaoImpl;
import cn.jr.pojo.Active;
import cn.jr.service.IActiveService;
import cn.jr.util.PageHelper;

import java.util.ArrayList;

public class ActiveServiceImpl implements IActiveService {
    IActiveDao iad = new ActiveDaoImpl();
    @Override
    public boolean addActive(Active active) {
        return iad.insertActive(active)>0?true:false;
    }

    @Override
    public ArrayList<Active> queryActive(Active at, PageHelper ph) {
        return iad.selectByActiveAndPageHelper(at, ph);
    }

    @Override
    public int queryCountByActiveAndPageHelper() {
        return iad.selectCountByActiveAndPageHelper();
    }

    @Override
    public boolean updateActive(Active active) {
        return iad.updateActive(active)>0?true:false;
    }

    @Override
    public boolean deleteActive(String activeId) {
        return iad.deleteActive(activeId)>0?true:false;
    }
}
